<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <title>乳腺癌预测结果</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.4/dist/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
  <style>
    body {
      background-color: #f8f9fa;
      font-family: 'Microsoft YaHei', Arial, sans-serif;
    }
    .result-container {
      margin-top: 30px;
      margin-bottom: 30px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
      border-radius: 10px;
      overflow: hidden;
    }
    .result-header {
      padding: 20px;
      color: white;
    }
    .benign-header {
      background: linear-gradient(135deg, #56ab2f, #a8e063);
    }
    .malignant-header {
      background: linear-gradient(135deg, #cb2d3e, #ef473a);
    }
    .result-body {
      padding: 30px;
      background-color: white;
    }
    .confidence-bar {
      height: 30px;
      border-radius: 15px;
      margin: 20px 0;
    }
    .benign-bar {
      background: linear-gradient(to right, #56ab2f, #a8e063);
    }
    .malignant-bar {
      background: linear-gradient(to right, #cb2d3e, #ef473a);
    }
    .analysis-section {
      background-color: #f8f9fa;
      border-radius: 10px;
      padding: 20px;
      margin-top: 20px;
    }
    .time-section {
      margin-top: 20px;
      color: #6c757d;
      font-style: italic;
    }
    .btn-back {
      margin-top: 20px;
    }
  </style>
</head>
<body>

<div class="container">
  <div class="row justify-content-center">
    <div class="col-md-10">
      <div class="result-container">
        <!-- 结果标题 -->
        <div class="result-header {% if output == 'Benign' %}benign-header{% else %}malignant-header{% endif %}">
          <h1 class="text-center">
            {% if output == 'Benign' %}
              <i class="fas fa-check-circle"></i> 预测结果：良性肿瘤
            {% else %}
              <i class="fas fa-exclamation-triangle"></i> 预测结果：恶性肿瘤
            {% endif %}
          </h1>
        </div>
        
        <!-- 结果详情 -->
        <div class="result-body">
          <h3>置信度: {{ accuracy }}%</h3>
          
          <!-- 置信度进度条 -->
          <div class="progress confidence-bar">
            <div class="progress-bar {% if output == 'Benign' %}benign-bar{% else %}malignant-bar{% endif %}" 
                 role="progressbar" 
                 style="width: {{ accuracy }}%" 
                 aria-valuenow="{{ accuracy }}" 
                 aria-valuemin="0" 
                 aria-valuemax="100">
              {{ accuracy }}%
            </div>
          </div>
          
          <!-- AI 分析部分 -->
          <div class="analysis-section">
            <h4><i class="fas fa-robot"></i> DeepSeek AI 分析依据</h4>
            <div class="card">
              <div class="card-body">
                <p class="card-text">{{ analysis }}</p>
              </div>
            </div>
          </div>
          
          <!-- 处理时间 -->
          <div class="time-section text-right">
            <p>处理时间: {{ time|round(2) }} 秒</p>
          </div>
          
          <!-- 返回按钮 -->
          <div class="text-center">
            <a href="/" class="btn btn-primary btn-lg btn-back">
              <i class="fas fa-arrow-left"></i> 返回首页
            </a>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

</body>
</html>
